<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<title>Inter Constructs</title>
<link href="../docs-assets/Breadcrumbs.css" rel="stylesheet" rev="stylesheet" type="text/css">
		<meta name="viewport" content="width=device-width initial-scale=1">
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
		<meta http-equiv="Content-Language" content="en-gb">

<link href="../docs-assets/Contents.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Progress.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Navigation.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Fonts.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Base.css" rel="stylesheet" rev="stylesheet" type="text/css">
<script>
function togglePopup(material_id) {
  var popup = document.getElementById(material_id);
  popup.classList.toggle("show");
}
</script>

<link href="../docs-assets/Popups.css" rel="stylesheet" rev="stylesheet" type="text/css">
<link href="../docs-assets/Colours.css" rel="stylesheet" rev="stylesheet" type="text/css">
		
	</head>
	<body class="commentary-font">
		<nav role="navigation">
		<h1><a href="../index.html"><img src="../docs-assets/Inform.png" height=72> </a></h1>
<ul><li><a href="../index.html">home</a></li>
</ul><h2>Compiler</h2><ul>
<li><a href="../structure.html">structure</a></li>
<li><a href="../inbuildn.html">inbuild</a></li>
<li><a href="../inform7n.html">inform7</a></li>
<li><a href="../intern.html">inter</a></li>
<li><a href="../services.html">services</a></li>
<li><a href="../secrets.html">secrets</a></li>
</ul><h2>Other Tools</h2><ul>
<li><a href="../inblorbn.html">inblorb</a></li>
<li><a href="../inform6.html">inform6</a></li>
<li><a href="../inpolicyn.html">inpolicy</a></li>
</ul><h2>Resources</h2><ul>
<li><a href="../extensions.html">extensions</a></li>
<li><a href="../kits.html">kits</a></li>
</ul><h2>Repository</h2><ul>
<li><a href="https://github.com/ganelson/inform"><img src="../docs-assets/github.png" height=0> github</a></li>
</ul><h2>Related Projects</h2><ul>
<li><a href="https://github.com/ganelson/inweb"><img src="../docs-assets/github.png" height=0> inweb</a></li>
<li><a href="https://github.com/ganelson/intest"><img src="../docs-assets/github.png" height=0> intest</a></li>
</ul>
		</nav>
		<main role="main">
		<!-- Weave of 'Inter Constructs' generated by inweb -->
<div class="breadcrumbs">
    <ul class="crumbs"><li><a href="../index.html">Home</a></li><li><a href="../intern.html">Inter Modules</a></li><li><a href="index.html">bytecode</a></li><li><a href="index.html#3">Chapter 3: Their Instructions</a></li><li><b>Inter Constructs</b></li></ul></div>
<p class="purpose">There are around two dozen constructs in textual Inter source code, with each instruction in bytecode being a usage of one of them.</p>

<p class="commentary firstcommentary"><a id="SP1" class="paragraph-anchor"></a><b>&#167;1. </b>Each different construct is represented by an instance of the following:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="constant-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">construct_ID</span><span class="plain-syntax">; </span><span class="comment-syntax"> used to identify this in bytecode</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">construct_name</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">recognition_regexp</span><span class="plain-syntax">[</span><span class="constant-syntax">MAX_RECOGNITION_REGEXP_LENGTH</span><span class="plain-syntax">];</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">min_level</span><span class="plain-syntax">; </span><span class="comment-syntax"> min node tree depth within its package</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">max_level</span><span class="plain-syntax">; </span><span class="comment-syntax"> max node tree depth within its package</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">usage_permissions</span><span class="plain-syntax">; </span><span class="comment-syntax"> a bitmap of the </span><span class="extract"><span class="extract-syntax">*_ICUP</span></span><span class="comment-syntax"> values</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">min_extent</span><span class="plain-syntax">; </span><span class="comment-syntax"> min number of words in the frame for this instruction</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">max_extent</span><span class="plain-syntax">; </span><span class="comment-syntax"> max number of words in the frame for this instruction</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">symbol_defn_field</span><span class="plain-syntax">; </span><span class="comment-syntax"> if this instruction declares a symbol, -1 otherwise</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">TID_field</span><span class="plain-syntax">; </span><span class="comment-syntax"> if this instruction declares a symbol with a type, -1 otherwise</span>

<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="identifier-syntax">method_set</span><span class="plain-syntax"> *</span><span class="identifier-syntax">methods</span><span class="plain-syntax">; </span><span class="comment-syntax"> what it does is entirely specified by these</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">CLASS_DEFINITION</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="function-syntax">InterInstruction::create_construct</span><button class="popup" onclick="togglePopup('usagePopup1')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup1">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::create_construct</span></span>:<br/><a href="3-ic.html#SP9">&#167;9</a><br/>The Comment Construct - <a href="4-tcc.html#SP1">&#167;1</a><br/>The Constant Construct - <a href="4-tcc2.html#SP1">&#167;1</a><br/>The Insert Construct - <a href="4-tic.html#SP1">&#167;1</a><br/>The Instance Construct - <a href="4-tic2.html#SP1">&#167;1</a><br/>The Nop Construct - <a href="4-tnc.html#SP1">&#167;1</a><br/>The Origin Construct - <a href="4-toc.html#SP1">&#167;1</a><br/>The Package Construct - <a href="4-tpc.html#SP1">&#167;1</a><br/>The PackageType Construct - <a href="4-tpc2.html#SP1">&#167;1</a><br/>The Permission Construct - <a href="4-tpc3.html#SP1">&#167;1</a><br/>The Pragma Construct - <a href="4-tpc4.html#SP1">&#167;1</a><br/>The Primitive Construct - <a href="4-tpc5.html#SP1">&#167;1</a><br/>The Property Construct - <a href="4-tpc6.html#SP1">&#167;1</a><br/>The PropertyValue Construct - <a href="4-tpc7.html#SP1">&#167;1</a><br/>The Provenance Construct - <a href="4-tpc8.html#SP1">&#167;1</a><br/>The Typename Construct - <a href="4-ttc.html#SP1">&#167;1</a><br/>The Variable Construct - <a href="4-tvc.html#SP1">&#167;1</a><br/>The Assembly Construct - <a href="5-tac.html#SP1">&#167;1</a><br/>The Cast Construct - <a href="5-tcc.html#SP1">&#167;1</a><br/>The Code Construct - <a href="5-tcc2.html#SP1">&#167;1</a><br/>The Evaluation Construct - <a href="5-tec.html#SP1">&#167;1</a><br/>The Inv Construct - <a href="5-tic.html#SP1">&#167;1</a><br/>The Lab Construct - <a href="5-tlc.html#SP1">&#167;1</a><br/>The Label Construct - <a href="5-tlc2.html#SP1">&#167;1</a><br/>The Local Construct - <a href="5-tlc3.html#SP1">&#167;1</a><br/>The Ref Construct - <a href="5-trc.html#SP1">&#167;1</a><br/>The Reference Construct - <a href="5-trc2.html#SP1">&#167;1</a><br/>The Splat Construct - <a href="5-tsc.html#SP1">&#167;1</a><br/>The Val Construct - <a href="5-tvc.html#SP1">&#167;1</a><br/>The Plug Construct - <a href="6-tpc.html#SP1">&#167;1</a><br/>The Socket Construct - <a href="6-tsc.html#SP1">&#167;1</a><br/>The Version Construct - <a href="6-tvc.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="constant-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">ID</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">name</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax"> = </span><span class="identifier-syntax">CREATE</span><span class="plain-syntax">(</span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">construct_ID</span><span class="plain-syntax"> = </span><span class="identifier-syntax">ID</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">construct_name</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::duplicate</span><span class="plain-syntax">(</span><span class="identifier-syntax">name</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">recognition_regexp</span><span class="plain-syntax">[0] = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">min_level</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">max_level</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">usage_permissions</span><span class="plain-syntax"> = </span><span class="constant-syntax">INSIDE_PLAIN_PACKAGE_ICUP</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="3-ic.html#SP4" class="function-link"><span class="function-syntax">InterInstruction::data_extent_at_least</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">);</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">symbol_defn_field</span><span class="plain-syntax"> = -1;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">TID_field</span><span class="plain-syntax"> = -1;</span>

<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">methods</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Methods::new_set</span><span class="plain-syntax">();</span>

<span class="plain-syntax">    </span><a href="3-ic.html#SP13" class="function-link"><span class="function-syntax">InterInstruction::set_construct_for_ID</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">ID</span><span class="plain-syntax">, </span><span class="identifier-syntax">IC</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">IC</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<ul class="endnotetexts"><li>The structure inter_construct is accessed in 3/vi, 3/idt and here.</li></ul>
<p class="commentary firstcommentary"><a id="SP2" class="paragraph-anchor"></a><b>&#167;2. </b>Numerous constructs are for instructions which define symbols, and sometimes
those have a data type attached. If so, the symbol ID will live in one field
of an instruction made with that construct, and the data type (in TID form &mdash;
see <a href="3-idt.html" class="internal">Inter Data Types</a>) will live in another.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::defines_symbol_in_fields</span><button class="popup" onclick="togglePopup('usagePopup2')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup2">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::defines_symbol_in_fields</span></span>:<br/>The Constant Construct - <a href="4-tcc2.html#SP1">&#167;1</a><br/>The Instance Construct - <a href="4-tic2.html#SP1">&#167;1</a><br/>The Origin Construct - <a href="4-toc.html#SP1">&#167;1</a><br/>The Package Construct - <a href="4-tpc.html#SP1">&#167;1</a><br/>The PackageType Construct - <a href="4-tpc2.html#SP1">&#167;1</a><br/>The Primitive Construct - <a href="4-tpc5.html#SP1">&#167;1</a><br/>The Property Construct - <a href="4-tpc6.html#SP1">&#167;1</a><br/>The Typename Construct - <a href="4-ttc.html#SP1">&#167;1</a><br/>The Variable Construct - <a href="4-tvc.html#SP1">&#167;1</a><br/>The Label Construct - <a href="5-tlc2.html#SP1">&#167;1</a><br/>The Local Construct - <a href="5-tlc3.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">s</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">t</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">symbol_defn_field</span><span class="plain-syntax"> = </span><span class="identifier-syntax">s</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">TID_field</span><span class="plain-syntax"> = </span><span class="identifier-syntax">t</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP3" class="paragraph-anchor"></a><b>&#167;3. </b>Several fields specify restrictions on where, in an Inter tree, instructions
using this construct can appear. <span class="extract"><span class="extract-syntax">min_level</span></span> to <span class="extract"><span class="extract-syntax">max_level</span></span>, inclusive, give
the range of hierarchical levels within their packages which such instructions
can occur at.
</p>

<p class="commentary">By default, note that a construct can only be used at the top level of a package &mdash;
min and max both equal 0; and by default, it has no usage permissions at all.
Those must be explicitly granted when a new construct is created.
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">INFINITELY_DEEP</span><span class="plain-syntax"> </span><span class="constant-syntax">100000000</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">OUTSIDE_OF_PACKAGES_ICUP</span><span class="plain-syntax">  </span><span class="constant-syntax">1</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">INSIDE_PLAIN_PACKAGE_ICUP</span><span class="plain-syntax"> </span><span class="constant-syntax">2</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">INSIDE_CODE_PACKAGE_ICUP</span><span class="plain-syntax">  </span><span class="constant-syntax">4</span>
<span class="definition-keyword">define</span> <span class="constant-syntax">CAN_HAVE_CHILDREN_ICUP</span><span class="plain-syntax">    </span><span class="constant-syntax">8</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::permit</span><button class="popup" onclick="togglePopup('usagePopup3')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup3">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::permit</span></span>:<br/>The Comment Construct - <a href="4-tcc.html#SP1">&#167;1</a><br/>The Constant Construct - <a href="4-tcc2.html#SP1">&#167;1</a><br/>The Insert Construct - <a href="4-tic.html#SP1">&#167;1</a><br/>The Instance Construct - <a href="4-tic2.html#SP1">&#167;1</a><br/>The Nop Construct - <a href="4-tnc.html#SP1">&#167;1</a><br/>The Origin Construct - <a href="4-toc.html#SP1">&#167;1</a><br/>The Package Construct - <a href="4-tpc.html#SP1">&#167;1</a><br/>The PackageType Construct - <a href="4-tpc2.html#SP1">&#167;1</a><br/>The Permission Construct - <a href="4-tpc3.html#SP1">&#167;1</a><br/>The Pragma Construct - <a href="4-tpc4.html#SP1">&#167;1</a><br/>The Primitive Construct - <a href="4-tpc5.html#SP1">&#167;1</a><br/>The Property Construct - <a href="4-tpc6.html#SP1">&#167;1</a><br/>The PropertyValue Construct - <a href="4-tpc7.html#SP1">&#167;1</a><br/>The Provenance Construct - <a href="4-tpc8.html#SP1">&#167;1</a><br/>The Typename Construct - <a href="4-ttc.html#SP1">&#167;1</a><br/>The Variable Construct - <a href="4-tvc.html#SP1">&#167;1</a><br/>The Assembly Construct - <a href="5-tac.html#SP1">&#167;1</a><br/>The Cast Construct - <a href="5-tcc.html#SP1">&#167;1</a><br/>The Code Construct - <a href="5-tcc2.html#SP1">&#167;1</a><br/>The Evaluation Construct - <a href="5-tec.html#SP1">&#167;1</a><br/>The Inv Construct - <a href="5-tic.html#SP1">&#167;1</a><br/>The Lab Construct - <a href="5-tlc.html#SP1">&#167;1</a><br/>The Label Construct - <a href="5-tlc2.html#SP1">&#167;1</a><br/>The Local Construct - <a href="5-tlc3.html#SP1">&#167;1</a><br/>The Ref Construct - <a href="5-trc.html#SP1">&#167;1</a><br/>The Reference Construct - <a href="5-trc2.html#SP1">&#167;1</a><br/>The Splat Construct - <a href="5-tsc.html#SP1">&#167;1</a><br/>The Val Construct - <a href="5-tvc.html#SP1">&#167;1</a><br/>The Plug Construct - <a href="6-tpc.html#SP1">&#167;1</a><br/>The Socket Construct - <a href="6-tsc.html#SP1">&#167;1</a><br/>The Version Construct - <a href="6-tvc.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">usage</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">usage_permissions</span><span class="plain-syntax"> |= </span><span class="identifier-syntax">usage</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::allow_in_depth_range</span><button class="popup" onclick="togglePopup('usagePopup4')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup4">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::allow_in_depth_range</span></span>:<br/><a href="3-ic.html#SP9">&#167;9</a><br/>The Comment Construct - <a href="4-tcc.html#SP1">&#167;1</a><br/>The Nop Construct - <a href="4-tnc.html#SP1">&#167;1</a><br/>The Provenance Construct - <a href="4-tpc8.html#SP1">&#167;1</a><br/>The Assembly Construct - <a href="5-tac.html#SP1">&#167;1</a><br/>The Cast Construct - <a href="5-tcc.html#SP1">&#167;1</a><br/>The Code Construct - <a href="5-tcc2.html#SP1">&#167;1</a><br/>The Evaluation Construct - <a href="5-tec.html#SP1">&#167;1</a><br/>The Inv Construct - <a href="5-tic.html#SP1">&#167;1</a><br/>The Lab Construct - <a href="5-tlc.html#SP1">&#167;1</a><br/>The Label Construct - <a href="5-tlc2.html#SP1">&#167;1</a><br/>The Ref Construct - <a href="5-trc.html#SP1">&#167;1</a><br/>The Reference Construct - <a href="5-trc2.html#SP1">&#167;1</a><br/>The Splat Construct - <a href="5-tsc.html#SP1">&#167;1</a><br/>The Val Construct - <a href="5-tvc.html#SP1">&#167;1</a><br/>The Plug Construct - <a href="6-tpc.html#SP1">&#167;1</a><br/>The Socket Construct - <a href="6-tsc.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">l1</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">l2</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">min_level</span><span class="plain-syntax"> = </span><span class="identifier-syntax">l1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">max_level</span><span class="plain-syntax"> = </span><span class="identifier-syntax">l2</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP4" class="paragraph-anchor"></a><b>&#167;4. </b>The instruction can be constrained to have a given length, in terms of the
number of words of bytecode it occupies:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::data_extent_always</span><button class="popup" onclick="togglePopup('usagePopup5')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup5">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::data_extent_always</span></span>:<br/>The Comment Construct - <a href="4-tcc.html#SP1">&#167;1</a><br/>The Insert Construct - <a href="4-tic.html#SP1">&#167;1</a><br/>The Instance Construct - <a href="4-tic2.html#SP1">&#167;1</a><br/>The Nop Construct - <a href="4-tnc.html#SP1">&#167;1</a><br/>The Package Construct - <a href="4-tpc.html#SP1">&#167;1</a><br/>The PackageType Construct - <a href="4-tpc2.html#SP1">&#167;1</a><br/>The Permission Construct - <a href="4-tpc3.html#SP1">&#167;1</a><br/>The Pragma Construct - <a href="4-tpc4.html#SP1">&#167;1</a><br/>The Property Construct - <a href="4-tpc6.html#SP1">&#167;1</a><br/>The PropertyValue Construct - <a href="4-tpc7.html#SP1">&#167;1</a><br/>The Provenance Construct - <a href="4-tpc8.html#SP1">&#167;1</a><br/>The Variable Construct - <a href="4-tvc.html#SP1">&#167;1</a><br/>The Assembly Construct - <a href="5-tac.html#SP1">&#167;1</a><br/>The Cast Construct - <a href="5-tcc.html#SP1">&#167;1</a><br/>The Code Construct - <a href="5-tcc2.html#SP1">&#167;1</a><br/>The Evaluation Construct - <a href="5-tec.html#SP1">&#167;1</a><br/>The Inv Construct - <a href="5-tic.html#SP1">&#167;1</a><br/>The Lab Construct - <a href="5-tlc.html#SP1">&#167;1</a><br/>The Label Construct - <a href="5-tlc2.html#SP1">&#167;1</a><br/>The Local Construct - <a href="5-tlc3.html#SP1">&#167;1</a><br/>The Ref Construct - <a href="5-trc.html#SP1">&#167;1</a><br/>The Reference Construct - <a href="5-trc2.html#SP1">&#167;1</a><br/>The Splat Construct - <a href="5-tsc.html#SP1">&#167;1</a><br/>The Val Construct - <a href="5-tvc.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">l</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">min_extent</span><span class="plain-syntax"> = </span><span class="identifier-syntax">l</span><span class="plain-syntax"> + </span><span class="constant-syntax">DATA_IFLD</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">max_extent</span><span class="plain-syntax"> = </span><span class="identifier-syntax">l</span><span class="plain-syntax"> + </span><span class="constant-syntax">DATA_IFLD</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::data_extent_at_least</span><button class="popup" onclick="togglePopup('usagePopup6')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup6">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::data_extent_at_least</span></span>:<br/><a href="3-ic.html#SP1">&#167;1</a><br/>The Constant Construct - <a href="4-tcc2.html#SP1">&#167;1</a><br/>The Origin Construct - <a href="4-toc.html#SP1">&#167;1</a><br/>The Primitive Construct - <a href="4-tpc5.html#SP1">&#167;1</a><br/>The Typename Construct - <a href="4-ttc.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">l</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">min_extent</span><span class="plain-syntax"> = </span><span class="identifier-syntax">l</span><span class="plain-syntax"> + </span><span class="constant-syntax">DATA_IFLD</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">max_extent</span><span class="plain-syntax"> = </span><span class="constant-syntax">0x7fffffff</span><span class="plain-syntax">; </span><span class="comment-syntax"> i.e., unlimited</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP5" class="paragraph-anchor"></a><b>&#167;5. </b>So here is the code to police those restrictions. First, for a node already
in position:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="function-syntax">InterInstruction::check_permissions</span><button class="popup" onclick="togglePopup('usagePopup7')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup7">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::check_permissions</span></span>:<br/><a href="3-ic.html#SP6">&#167;6</a>, <a href="3-ic.html#SP7">&#167;7</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_error_location</span><span class="plain-syntax"> *</span><span class="identifier-syntax">eloc</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">need</span><span class="plain-syntax"> = </span><span class="constant-syntax">INSIDE_PLAIN_PACKAGE_ICUP</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="identifier-syntax">need</span><span class="plain-syntax"> = </span><span class="constant-syntax">OUTSIDE_OF_PACKAGES_ICUP</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-pck.html#SP16" class="function-link"><span class="function-syntax">InterPackage::is_a_function_body</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">)) </span><span class="identifier-syntax">need</span><span class="plain-syntax"> = </span><span class="constant-syntax">INSIDE_CODE_PACKAGE_ICUP</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">usage_permissions</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">need</span><span class="plain-syntax">) != </span><span class="identifier-syntax">need</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">M</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::new</span><span class="plain-syntax">();</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">M</span><span class="plain-syntax">, </span><span class="string-syntax">"construct '%S' cannot be used "</span><span class="plain-syntax">, </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">construct_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">switch</span><span class="plain-syntax"> (</span><span class="identifier-syntax">need</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">OUTSIDE_OF_PACKAGES_ICUP:</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">M</span><span class="plain-syntax">, </span><span class="string-syntax">"outside packages"</span><span class="plain-syntax">); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">INSIDE_PLAIN_PACKAGE_ICUP:</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">M</span><span class="plain-syntax">, </span><span class="string-syntax">"inside non-code package '%S'"</span><span class="plain-syntax">, </span><a href="2-pck.html#SP7" class="function-link"><span class="function-syntax">InterPackage::name</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">)); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">case</span><span class="plain-syntax"> </span><span class="identifier-syntax">INSIDE_CODE_PACKAGE_ICUP:</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">M</span><span class="plain-syntax">, </span><span class="string-syntax">"inside code package '%S'"</span><span class="plain-syntax">, </span><a href="2-pck.html#SP7" class="function-link"><span class="function-syntax">InterPackage::name</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">)); </span><span class="reserved-syntax">break</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-ie.html#SP4" class="function-link"><span class="function-syntax">InterErrors::plain</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">M</span><span class="plain-syntax">, </span><span class="identifier-syntax">eloc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::allows</span><span class="plain-syntax">(</span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">icup</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">usage_permissions</span><span class="plain-syntax"> &amp; </span><span class="identifier-syntax">icup</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP6" class="paragraph-anchor"></a><b>&#167;6. </b>Second, for a proposed use of node not yet in position &mdash; this is used when
reading textual inter, hence the message about indentation:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="function-syntax">InterInstruction::check_level_in_package</span><button class="popup" onclick="togglePopup('usagePopup8')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup8">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::check_level_in_package</span></span>:<br/><a href="3-ic.html#SP21">&#167;21</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">proposed</span><span class="plain-syntax">, </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">level</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_error_location</span><span class="plain-syntax"> *</span><span class="identifier-syntax">eloc</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">pack</span><span class="plain-syntax"> = </span><a href="2-bkm.html#SP6" class="function-link"><span class="function-syntax">InterBookmark::package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">actual</span><span class="plain-syntax"> = </span><span class="identifier-syntax">level</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">pack</span><span class="plain-syntax">) &amp;&amp; (</span><a href="2-pck.html#SP15" class="function-link"><span class="function-syntax">InterPackage::is_a_root_package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">pack</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">actual</span><span class="plain-syntax"> = </span><span class="identifier-syntax">level</span><span class="plain-syntax"> - </span><a href="2-bkm.html#SP7" class="function-link"><span class="function-syntax">InterBookmark::baseline</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) - </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">actual</span><span class="plain-syntax"> &lt; </span><span class="constant-syntax">0</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-ie.html#SP4" class="function-link"><span class="function-syntax">InterErrors::plain</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"impossible level"</span><span class="plain-syntax">, </span><span class="identifier-syntax">eloc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">actual</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">proposed</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">min_level</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">actual</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">proposed</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">max_level</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-ie.html#SP4" class="function-link"><span class="function-syntax">InterErrors::plain</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"indentation error"</span><span class="plain-syntax">, </span><span class="identifier-syntax">eloc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-ic.html#SP5" class="function-link"><span class="function-syntax">InterInstruction::check_permissions</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">proposed</span><span class="plain-syntax">, </span><span class="identifier-syntax">pack</span><span class="plain-syntax">, </span><span class="identifier-syntax">eloc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP7" class="paragraph-anchor"></a><b>&#167;7. </b>A much more formidable check. This traverses an entire tree, and verifies
that every construct is legally used:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">typedef</span><span class="plain-syntax"> </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">tree_lint_state</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">struct</span><span class="plain-syntax"> </span><span class="reserved-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="constant-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">package_level</span><span class="plain-syntax">;</span>
<span class="plain-syntax">} </span><span class="reserved-syntax">tree_lint_state</span><span class="plain-syntax">;</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::tree_lint</span><button class="popup" onclick="togglePopup('usagePopup9')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup9">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::tree_lint</span></span>:<br/>Inter in Binary Files - <a href="3-iibf.html#SP10">&#167;10</a><br/>Inter in Text Files - <a href="3-iitf.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">tree_lint_state</span><span class="plain-syntax"> </span><span class="identifier-syntax">tls</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tls</span><span class="plain-syntax">.</span><span class="element-syntax">package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">root_package</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">tls</span><span class="plain-syntax">.</span><span class="element-syntax">package_level</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="3-ic.html#SP7" class="function-link"><span class="function-syntax">InterInstruction::tree_lint_r</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">root_node</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">tls</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::tree_lint_r</span><span class="plain-syntax">(</span><span class="reserved-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="reserved-syntax">tree_lint_state</span><span class="plain-syntax"> *</span><span class="identifier-syntax">tls</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_THROUGH_INTER_CHILDREN</span><span class="plain-syntax">(</span><span class="identifier-syntax">C</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-in.html#SP6" class="function-link"><span class="function-syntax">Inode::get_package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">C</span><span class="plain-syntax">) != </span><span class="identifier-syntax">tls</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">package</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">STDERR</span><span class="plain-syntax">, </span><span class="string-syntax">"Node gives package as "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="2-pck.html#SP19" class="function-link"><span class="function-syntax">InterPackage::write_URL</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">STDERR</span><span class="plain-syntax">, </span><a href="2-in.html#SP6" class="function-link"><span class="function-syntax">Inode::get_package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">C</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">STDERR</span><span class="plain-syntax">, </span><span class="string-syntax">" but it is actually in "</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><a href="2-pck.html#SP19" class="function-link"><span class="function-syntax">InterPackage::write_URL</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">STDERR</span><span class="plain-syntax">, </span><span class="identifier-syntax">tls</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">package</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">STDERR</span><span class="plain-syntax">, </span><span class="string-syntax">"\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"node in wrong package"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><a href="3-ic.html#SP14" class="function-link"><span class="function-syntax">InterInstruction::get_construct</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">C</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">IC</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">E</span><span class="plain-syntax">) </span><a href="3-ie.html#SP5" class="function-link"><span class="function-syntax">InterErrors::issue</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">E</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">IC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">inter_error_location</span><span class="plain-syntax"> *</span><span class="identifier-syntax">eloc</span><span class="plain-syntax"> = </span><a href="2-in.html#SP9" class="function-link"><span class="function-syntax">Inode::get_error_location</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">C</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><a href="3-ic.html#SP5" class="function-link"><span class="function-syntax">InterInstruction::check_permissions</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="identifier-syntax">tls</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">package</span><span class="plain-syntax">, </span><span class="identifier-syntax">eloc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">E</span><span class="plain-syntax">) </span><a href="3-ie.html#SP5" class="function-link"><span class="function-syntax">InterErrors::issue</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">E</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><a href="3-ic.html#SP17" class="function-link"><span class="function-syntax">InterInstruction::verify_children</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">C</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">E</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">                </span><a href="3-ie.html#SP5" class="function-link"><span class="function-syntax">InterErrors::issue</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">E</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><a href="3-ie.html#SP6" class="function-link"><span class="function-syntax">InterErrors::backtrace</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">STDERR</span><span class="plain-syntax">, </span><span class="identifier-syntax">C</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="constant-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">level</span><span class="plain-syntax"> = (</span><span class="constant-syntax">inter_ti</span><span class="plain-syntax">) </span><a href="2-in.html#SP13" class="function-link"><span class="function-syntax">Inode::get_level</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">C</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="constant-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">level_in_package</span><span class="plain-syntax"> = </span><span class="identifier-syntax">level</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">tls</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">package</span><span class="plain-syntax">) </span><span class="identifier-syntax">level_in_package</span><span class="plain-syntax"> -= </span><span class="identifier-syntax">tls</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">package_level</span><span class="plain-syntax">;</span>

<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">construct_ID</span><span class="plain-syntax"> != </span><span class="constant-syntax">PACKAGE_IST</span><span class="plain-syntax">) &amp;&amp;</span>
<span class="plain-syntax">                    (((</span><span class="reserved-syntax">int</span><span class="plain-syntax">) </span><span class="identifier-syntax">level_in_package</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">min_level</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">                        ((</span><span class="reserved-syntax">int</span><span class="plain-syntax">) </span><span class="identifier-syntax">level_in_package</span><span class="plain-syntax"> &gt; </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">max_level</span><span class="plain-syntax">))) {</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">M</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::new</span><span class="plain-syntax">();</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">M</span><span class="plain-syntax">, </span><span class="string-syntax">"construct '%S' used at level %d in its package, not %d to %d"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">construct_name</span><span class="plain-syntax">, </span><span class="identifier-syntax">level_in_package</span><span class="plain-syntax">, </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">min_level</span><span class="plain-syntax">, </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">max_level</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><a href="3-ie.html#SP5" class="function-link"><span class="function-syntax">InterErrors::issue</span></a><span class="plain-syntax">(</span><a href="3-ie.html#SP4" class="function-link"><span class="function-syntax">InterErrors::plain</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">M</span><span class="plain-syntax">, </span><span class="identifier-syntax">eloc</span><span class="plain-syntax">));</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-in.html#SP13" class="function-link"><span class="function-syntax">Inode::is</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">C</span><span class="plain-syntax">, </span><span class="constant-syntax">PACKAGE_IST</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">tree_lint_state</span><span class="plain-syntax"> </span><span class="identifier-syntax">inner_tls</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">inner_tls</span><span class="plain-syntax">.</span><span class="element-syntax">package</span><span class="plain-syntax"> = </span><a href="4-tpc.html#SP9" class="function-link"><span class="function-syntax">PackageInstruction::at_this_head</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">C</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">inner_tls</span><span class="plain-syntax">.</span><span class="element-syntax">package_level</span><span class="plain-syntax"> = </span><span class="identifier-syntax">level</span><span class="plain-syntax"> + </span><span class="constant-syntax">1</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><a href="3-ic.html#SP7" class="function-link"><span class="function-syntax">InterInstruction::tree_lint_r</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">C</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">inner_tls</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">LOOP_OVER_SYMBOLS_TABLE</span><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><a href="2-pck.html#SP10" class="function-link"><span class="function-syntax">InterPackage::scope</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">inner_tls</span><span class="plain-syntax">.</span><span class="element-syntax">package</span><span class="plain-syntax">))</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><a href="2-sym.html#SP6" class="function-link"><span class="function-syntax">InterSymbol::get_flag</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">, </span><span class="constant-syntax">SPECULATIVE_ISYMF</span><span class="plain-syntax">)) &amp;&amp;</span>
<span class="plain-syntax">                        (</span><a href="2-sym.html#SP15" class="function-link"><span class="function-syntax">InterSymbol::is_defined</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">) == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                        </span><a href="3-ie.html#SP5" class="function-link"><span class="function-syntax">InterErrors::issue</span></a><span class="plain-syntax">(</span><a href="3-ie.html#SP4" class="function-link"><span class="function-syntax">InterErrors::quoted</span></a><span class="plain-syntax">(</span>
<span class="plain-syntax">                            </span><span class="identifier-syntax">I</span><span class="string-syntax">"symbol undefined in package"</span><span class="plain-syntax">,</span>
<span class="plain-syntax">                            </span><a href="2-sym.html#SP19" class="function-link"><span class="function-syntax">InterSymbol::identifier</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">S</span><span class="plain-syntax">), </span><span class="identifier-syntax">eloc</span><span class="plain-syntax">));</span>
<span class="plain-syntax">                    }</span>
<span class="plain-syntax">            } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">                </span><a href="3-ic.html#SP7" class="function-link"><span class="function-syntax">InterInstruction::tree_lint_r</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="identifier-syntax">C</span><span class="plain-syntax">, </span><span class="identifier-syntax">tls</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<ul class="endnotetexts"><li>The structure tree_lint_state is accessed in 2/it, 2/in, 2/bkm, 2/trn and here.</li></ul>
<p class="commentary firstcommentary"><a id="SP8" class="paragraph-anchor"></a><b>&#167;8. </b>So much for a construct's invariants. Now we turn to the textual syntax for it,
which of course applies only to the textual form of Inter. Moreover, the syntax
fields of an <a href="3-ic.html#SP1" class="internal">inter_construct</a> are used only for parsing, and not for printing
instructions out again; it's just not worth the bother of doing it that way,
elegant as it might be. So note that if a syntax changes, the corresponding
function to write an instruction must change too.
</p>

<p class="commentary">So: <span class="extract"><span class="extract-syntax">syntax</span></span> specifies the textual format of the construct for parsing purposes.
It needs to be set up so that no two different constructs can match the same
line of text. The <span class="extract"><span class="extract-syntax">syntax</span></span> is easier to read than a regular expression, which is
what we turn it into. So for example <span class="extract"><span class="extract-syntax">deploy !IDENTIFIER</span></span> would match the
literal word <span class="extract"><span class="extract-syntax">deploy</span></span>, then any amount of white space, then a literal <span class="extract"><span class="extract-syntax">!</span></span> and
immediately following it an identifier.
</p>

<p class="commentary">Note that it is legal not to call this function, i.e., to create a construct
but give it no syntax. If so, it will be inexpressible in textual Inter code.
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">MAX_RECOGNITION_REGEXP_LENGTH</span><span class="plain-syntax"> </span><span class="constant-syntax">64</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::specify_syntax</span><button class="popup" onclick="togglePopup('usagePopup10')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup10">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::specify_syntax</span></span>:<br/>The Comment Construct - <a href="4-tcc.html#SP1">&#167;1</a><br/>The Constant Construct - <a href="4-tcc2.html#SP1">&#167;1</a><br/>The Insert Construct - <a href="4-tic.html#SP1">&#167;1</a><br/>The Instance Construct - <a href="4-tic2.html#SP1">&#167;1</a><br/>The Origin Construct - <a href="4-toc.html#SP1">&#167;1</a><br/>The Package Construct - <a href="4-tpc.html#SP1">&#167;1</a><br/>The PackageType Construct - <a href="4-tpc2.html#SP1">&#167;1</a><br/>The Permission Construct - <a href="4-tpc3.html#SP1">&#167;1</a><br/>The Pragma Construct - <a href="4-tpc4.html#SP1">&#167;1</a><br/>The Primitive Construct - <a href="4-tpc5.html#SP1">&#167;1</a><br/>The Property Construct - <a href="4-tpc6.html#SP1">&#167;1</a><br/>The PropertyValue Construct - <a href="4-tpc7.html#SP1">&#167;1</a><br/>The Provenance Construct - <a href="4-tpc8.html#SP1">&#167;1</a><br/>The Typename Construct - <a href="4-ttc.html#SP1">&#167;1</a><br/>The Variable Construct - <a href="4-tvc.html#SP1">&#167;1</a><br/>The Assembly Construct - <a href="5-tac.html#SP1">&#167;1</a><br/>The Cast Construct - <a href="5-tcc.html#SP1">&#167;1</a><br/>The Code Construct - <a href="5-tcc2.html#SP1">&#167;1</a><br/>The Evaluation Construct - <a href="5-tec.html#SP1">&#167;1</a><br/>The Inv Construct - <a href="5-tic.html#SP1">&#167;1</a><br/>The Lab Construct - <a href="5-tlc.html#SP1">&#167;1</a><br/>The Label Construct - <a href="5-tlc2.html#SP1">&#167;1</a><br/>The Local Construct - <a href="5-tlc3.html#SP1">&#167;1</a><br/>The Ref Construct - <a href="5-trc.html#SP1">&#167;1</a><br/>The Reference Construct - <a href="5-trc2.html#SP1">&#167;1</a><br/>The Splat Construct - <a href="5-tsc.html#SP1">&#167;1</a><br/>The Val Construct - <a href="5-tvc.html#SP1">&#167;1</a><br/>The Plug Construct - <a href="6-tpc.html#SP1">&#167;1</a><br/>The Socket Construct - <a href="6-tsc.html#SP1">&#167;1</a><br/>The Version Construct - <a href="6-tvc.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">syntax</span><span class="plain-syntax"> = </span><span class="identifier-syntax">syntax</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">TEMPORARY_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">)</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax"> &lt; </span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">); </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::includes_wide_string_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"OPTIONALIDENTIFIER"</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">i</span><span class="plain-syntax"> += </span><span class="constant-syntax">17</span><span class="plain-syntax">; </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="string-syntax">"*(%%i*)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::includes_wide_string_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"WHITESPACE"</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">i</span><span class="plain-syntax"> += </span><span class="constant-syntax">9</span><span class="plain-syntax">;  </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="string-syntax">" *"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::includes_wide_string_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"IDENTIFIER"</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">i</span><span class="plain-syntax"> += </span><span class="constant-syntax">9</span><span class="plain-syntax">;  </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="string-syntax">"(%%C+)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::includes_wide_string_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"_IDENTIFIER"</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">i</span><span class="plain-syntax"> += </span><span class="constant-syntax">10</span><span class="plain-syntax">; </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="string-syntax">"(_%%i+)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::includes_wide_string_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">".IDENTIFIER"</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">i</span><span class="plain-syntax"> += </span><span class="constant-syntax">10</span><span class="plain-syntax">; </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="string-syntax">"(.%%i+)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::includes_wide_string_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"!IDENTIFIER"</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">i</span><span class="plain-syntax"> += </span><span class="constant-syntax">10</span><span class="plain-syntax">; </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="string-syntax">"(!%%i+)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::includes_wide_string_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"IDENTIFIER"</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">i</span><span class="plain-syntax"> += </span><span class="constant-syntax">9</span><span class="plain-syntax">; </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="string-syntax">"(%%i+)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::includes_wide_string_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"NUMBER"</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">i</span><span class="plain-syntax"> += </span><span class="constant-syntax">5</span><span class="plain-syntax">; </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="string-syntax">"(%%d+)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::includes_wide_string_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"TOKENS"</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">i</span><span class="plain-syntax"> += </span><span class="constant-syntax">5</span><span class="plain-syntax">; </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="string-syntax">"(%%c+)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::includes_wide_string_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"MINTOKENS"</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">i</span><span class="plain-syntax"> += </span><span class="constant-syntax">8</span><span class="plain-syntax">; </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="string-syntax">"(%%c+?)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::includes_wide_string_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"TOKEN"</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">i</span><span class="plain-syntax"> += </span><span class="constant-syntax">4</span><span class="plain-syntax">; </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="string-syntax">"(%%C+)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::includes_wide_string_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"TEXT"</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">i</span><span class="plain-syntax"> += </span><span class="constant-syntax">3</span><span class="plain-syntax">; </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="string-syntax">"\"(%%c*)\""</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::includes_wide_string_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">U</span><span class="string-syntax">"ANY"</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">i</span><span class="plain-syntax"> += </span><span class="constant-syntax">2</span><span class="plain-syntax">; </span><span class="identifier-syntax">WRITE_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="string-syntax">"(%%c*)"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        } </span><span class="reserved-syntax">else</span><span class="plain-syntax"> {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">inchar32_t</span><span class="plain-syntax"> </span><span class="identifier-syntax">c</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::get_at</span><span class="plain-syntax">(</span><span class="identifier-syntax">syntax</span><span class="plain-syntax">, </span><span class="identifier-syntax">i</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">c</span><span class="plain-syntax"> == </span><span class="character-syntax">'\''</span><span class="plain-syntax">) </span><span class="identifier-syntax">c</span><span class="plain-syntax"> = </span><span class="character-syntax">'"'</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">PUT_TO</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">, </span><span class="identifier-syntax">c</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">) &gt;= </span><span class="constant-syntax">MAX_RECOGNITION_REGEXP_LENGTH</span><span class="plain-syntax"> - </span><span class="constant-syntax">1</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"too much syntax"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">j</span><span class="plain-syntax"> = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_THROUGH_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">, </span><span class="identifier-syntax">regexp</span><span class="plain-syntax">) </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">recognition_regexp</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">++] = </span><span class="identifier-syntax">Str::get</span><span class="plain-syntax">(</span><span class="identifier-syntax">pos</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">recognition_regexp</span><span class="plain-syntax">[</span><span class="identifier-syntax">j</span><span class="plain-syntax">++] = </span><span class="constant-syntax">0</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">DISCARD_TEXT</span><span class="plain-syntax">(</span><span class="identifier-syntax">regexp</span><span class="plain-syntax">)</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP9" class="paragraph-anchor"></a><b>&#167;9. </b>There isn't really a construct with ID 0: this is used only as a sort of "not
a legal construct" value. Notice the way we give it no syntax, grant it no
permissions, and allow it only in an impossible range. So this cannot be expressed
in textual Inter, and cannot be stored in bytecode binary Inter either.
</p>

<pre class="definitions code-font"><span class="definition-keyword">enum</span> <span class="constant-syntax">INVALID_IST</span><span class="plain-syntax"> </span><span class="identifier-syntax">from</span><span class="plain-syntax"> </span><span class="constant-syntax">0</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::define_invalid_construct</span><button class="popup" onclick="togglePopup('usagePopup11')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup11">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::define_invalid_construct</span></span>:<br/><a href="3-ic.html#SP15">&#167;15</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax"> = </span><a href="3-ic.html#SP1" class="function-link"><span class="function-syntax">InterInstruction::create_construct</span></a><span class="plain-syntax">(</span><span class="constant-syntax">INVALID_IST</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"invalid"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="3-ic.html#SP3" class="function-link"><span class="function-syntax">InterInstruction::allow_in_depth_range</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="constant-syntax">0</span><span class="plain-syntax">, -1);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP10" class="paragraph-anchor"></a><b>&#167;10. </b>The valid construct IDs then count upwards from there. Note that changing any
of these values would invalidate existing Inter binary files, necessitating a
bump of <a href="1-tiv.html" class="internal">The Inter Version</a>.
</p>

<p class="commentary">These are constructs used for instructions outside function bodies:
</p>

<pre class="definitions code-font"><span class="definition-keyword">enum</span> <span class="constant-syntax">COMMENT_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">CONSTANT_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">INSERT_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">INSTANCE_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">NOP_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">ORIGIN_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">PACKAGE_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">PACKAGETYPE_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">PERMISSION_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">PRAGMA_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">PRIMITIVE_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">PROPERTY_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">PROPERTYVALUE_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">PROVENANCE_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">TYPENAME_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">VARIABLE_IST</span>
</pre>
<p class="commentary firstcommentary"><a id="SP11" class="paragraph-anchor"></a><b>&#167;11. </b>These are constructs used for instructions inside function bodies:
</p>

<pre class="definitions code-font"><span class="definition-keyword">enum</span> <span class="constant-syntax">ASSEMBLY_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">CAST_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">CODE_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">EVALUATION_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">INV_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">LAB_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">LABEL_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">LOCAL_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">REF_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">REFERENCE_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">SPLAT_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">VAL_IST</span>
</pre>
<p class="commentary firstcommentary"><a id="SP12" class="paragraph-anchor"></a><b>&#167;12. </b>These are pseudo-constructs, in that they do not create instructions, and
instead specify something else about the tree:
</p>

<pre class="definitions code-font"><span class="definition-keyword">enum</span> <span class="constant-syntax">PLUG_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">SOCKET_IST</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">VERSION_IST</span>
</pre>
<p class="commentary firstcommentary"><a id="SP13" class="paragraph-anchor"></a><b>&#167;13. </b>Since these IDs are stored in the bytecode for an instruction, in fact in the
0th word of the frame, we will need to convert them to their <a href="3-ic.html#SP1" class="internal">inter_construct</a>
equivalents quickly. So we store a lookup table:
</p>

<pre class="definitions code-font"><span class="definition-keyword">define</span> <span class="constant-syntax">MAX_INTER_CONSTRUCTS</span><span class="plain-syntax"> </span><span class="constant-syntax">100</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_construct_by_ID_ready</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">inter_construct_by_ID</span><span class="plain-syntax">[</span><span class="constant-syntax">MAX_INTER_CONSTRUCTS</span><span class="plain-syntax">];</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::set_construct_for_ID</span><button class="popup" onclick="togglePopup('usagePopup12')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup12">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::set_construct_for_ID</span></span>:<br/><a href="3-ic.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="constant-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">ID</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">inter_construct_by_ID_ready</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">inter_construct_by_ID_ready</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">MAX_INTER_CONSTRUCTS</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) </span><span class="identifier-syntax">inter_construct_by_ID</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">] = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">ID</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">MAX_INTER_CONSTRUCTS</span><span class="plain-syntax">) </span><span class="identifier-syntax">internal_error</span><span class="plain-syntax">(</span><span class="string-syntax">"too many constructs"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">inter_construct_by_ID</span><span class="plain-syntax">[</span><span class="identifier-syntax">ID</span><span class="plain-syntax">] = </span><span class="identifier-syntax">IC</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="function-syntax">InterInstruction::get_construct_for_ID</span><button class="popup" onclick="togglePopup('usagePopup13')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup13">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::get_construct_for_ID</span></span>:<br/><a href="3-ic.html#SP14">&#167;14</a></span></button><span class="plain-syntax">(</span><span class="constant-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">ID</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">ID</span><span class="plain-syntax"> == </span><span class="constant-syntax">INVALID_IST</span><span class="plain-syntax">) || (</span><span class="identifier-syntax">ID</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">MAX_INTER_CONSTRUCTS</span><span class="plain-syntax">) ||</span>
<span class="plain-syntax">        (</span><span class="identifier-syntax">inter_construct_by_ID_ready</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">inter_construct_by_ID</span><span class="plain-syntax">[</span><span class="identifier-syntax">ID</span><span class="plain-syntax">];</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP14" class="paragraph-anchor"></a><b>&#167;14. </b>Whence, in a faintly paranoid way:
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="function-syntax">InterInstruction::get_construct</span><button class="popup" onclick="togglePopup('usagePopup14')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup14">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::get_construct</span></span>:<br/><a href="3-ic.html#SP7">&#167;7</a>, <a href="3-ic.html#SP17">&#167;17</a>, <a href="3-ic.html#SP18">&#167;18</a>, <a href="3-ic.html#SP19">&#167;19</a>, <a href="3-ic.html#SP22">&#167;22</a><br/>Verifying Inter - <a href="3-vi.html#SP1">&#167;1</a><br/>Inter Data Types - <a href="3-idt.html#SP24">&#167;24</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> **</span><span class="identifier-syntax">to</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">P</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="2-in.html#SP15" class="function-link"><span class="function-syntax">Inode::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"invalid node"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax"> = </span><a href="3-ic.html#SP13" class="function-link"><span class="function-syntax">InterInstruction::get_construct_for_ID</span></a><span class="plain-syntax">(</span><a href="2-in.html#SP13" class="function-link"><span class="function-syntax">Inode::get_construct_ID</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">));</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">IC</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="2-in.html#SP15" class="function-link"><span class="function-syntax">Inode::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"no such construct"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">to</span><span class="plain-syntax">) *</span><span class="identifier-syntax">to</span><span class="plain-syntax"> = </span><span class="identifier-syntax">IC</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP15" class="paragraph-anchor"></a><b>&#167;15. </b>Each construct is managed by its own section of code, and that includes
the creation of the constructs: so we poll those sections in turn.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::create_language</span><button class="popup" onclick="togglePopup('usagePopup15')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup15">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::create_language</span></span>:<br/>Bytecode Module - <a href="1-bm.html#SP3">&#167;3</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">void</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><a href="2-ann.html#SP4" class="function-link"><span class="function-syntax">SymbolAnnotation::declare_canonical_annotations</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="3-ic.html#SP9" class="function-link"><span class="function-syntax">InterInstruction::define_invalid_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tnc.html#SP1" class="function-link"><span class="function-syntax">NopInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tcc.html#SP1" class="function-link"><span class="function-syntax">CommentInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-toc.html#SP1" class="function-link"><span class="function-syntax">OriginInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tpc8.html#SP1" class="function-link"><span class="function-syntax">ProvenanceInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="6-tpc.html#SP1" class="function-link"><span class="function-syntax">PlugInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="6-tsc.html#SP1" class="function-link"><span class="function-syntax">SocketInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="6-tvc.html#SP1" class="function-link"><span class="function-syntax">VersionInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tpc4.html#SP1" class="function-link"><span class="function-syntax">PragmaInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tic.html#SP1" class="function-link"><span class="function-syntax">InsertInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-ttc.html#SP1" class="function-link"><span class="function-syntax">TypenameInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tcc2.html#SP1" class="function-link"><span class="function-syntax">ConstantInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tic2.html#SP1" class="function-link"><span class="function-syntax">InstanceInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tvc.html#SP1" class="function-link"><span class="function-syntax">VariableInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tpc6.html#SP1" class="function-link"><span class="function-syntax">PropertyInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tpc3.html#SP1" class="function-link"><span class="function-syntax">PermissionInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tpc7.html#SP1" class="function-link"><span class="function-syntax">PropertyValueInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tpc5.html#SP1" class="function-link"><span class="function-syntax">PrimitiveInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tpc.html#SP1" class="function-link"><span class="function-syntax">PackageInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="4-tpc2.html#SP1" class="function-link"><span class="function-syntax">PackageTypeInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="5-tlc2.html#SP1" class="function-link"><span class="function-syntax">LabelInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="5-tlc3.html#SP1" class="function-link"><span class="function-syntax">LocalInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="5-tic.html#SP1" class="function-link"><span class="function-syntax">InvInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="5-trc.html#SP1" class="function-link"><span class="function-syntax">RefInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="5-tvc.html#SP1" class="function-link"><span class="function-syntax">ValInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="5-tlc.html#SP1" class="function-link"><span class="function-syntax">LabInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="5-tac.html#SP1" class="function-link"><span class="function-syntax">AssemblyInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="5-tcc2.html#SP1" class="function-link"><span class="function-syntax">CodeInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="5-tec.html#SP1" class="function-link"><span class="function-syntax">EvaluationInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="5-trc2.html#SP1" class="function-link"><span class="function-syntax">ReferenceInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="5-tcc.html#SP1" class="function-link"><span class="function-syntax">CastInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">    </span><a href="5-tsc.html#SP1" class="function-link"><span class="function-syntax">SplatInstruction::define_construct</span></a><span class="plain-syntax">();</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP16" class="paragraph-anchor"></a><b>&#167;16. </b>The result is printed when <a href="../inter/index.html" class="internal">inter</a> is run with the <span class="extract"><span class="extract-syntax">-constructs</span></span> switch.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::show_constructs</span><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"  Code     Construct           Syntax\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">ID</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">ID</span><span class="plain-syntax">&lt;</span><span class="constant-syntax">MAX_INTER_CONSTRUCTS</span><span class="plain-syntax">; </span><span class="identifier-syntax">ID</span><span class="plain-syntax">++) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax"> = </span><span class="identifier-syntax">inter_construct_by_ID</span><span class="plain-syntax">[</span><span class="identifier-syntax">ID</span><span class="plain-syntax">];</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><span class="identifier-syntax">IC</span><span class="plain-syntax">) &amp;&amp; (</span><span class="identifier-syntax">ID</span><span class="plain-syntax"> != </span><span class="constant-syntax">INVALID_IST</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"  %4x     %S"</span><span class="plain-syntax">, </span><span class="identifier-syntax">ID</span><span class="plain-syntax">, </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">construct_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">j</span><span class="plain-syntax"> = </span><span class="identifier-syntax">Str::len</span><span class="plain-syntax">(</span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">construct_name</span><span class="plain-syntax">); </span><span class="identifier-syntax">j</span><span class="plain-syntax">&lt;20; </span><span class="identifier-syntax">j</span><span class="plain-syntax">++) </span><span class="identifier-syntax">PUT</span><span class="plain-syntax">(</span><span class="character-syntax">' '</span><span class="plain-syntax">);</span>
<span class="plain-syntax">            </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%S\n"</span><span class="plain-syntax">, </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">syntax</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        }</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP17" class="paragraph-anchor"></a><b>&#167;17. </b>Okay then! We have our constructs: what shall we do with them?
</p>

<p class="commentary">The answer is that each construct behaves differently, in ways specified by
the following method calls on the relevant <a href="3-ic.html#SP1" class="internal">inter_construct</a>.
</p>

<p class="commentary">Firstly, each construct has a method for verifying (i) that it is being used in
a self-consistent way by the given instruction, and (ii) that it can see child
nodes to that instruction of a kind it expects.
</p>

<p class="commentary"><a href="3-ic.html#SP17" class="internal">InterInstruction::verify</a> should be called only by <a href="3-vi.html#SP1" class="internal">VerifyingInter::instruction</a>,
which ensures that <a href="3-ic.html#SP17" class="internal">InterInstruction::verify</a> is never called twice on the same
instruction. <span class="extract"><span class="extract-syntax">CONSTRUCT_VERIFY_MTID</span></span> methods for the constructs can therefore
safely assume that.
</p>

<pre class="definitions code-font"><span class="definition-keyword">enum</span> <span class="constant-syntax">CONSTRUCT_VERIFY_MTID</span>
<span class="definition-keyword">enum</span> <span class="constant-syntax">CONSTRUCT_VERIFY_CHILDREN_MTID</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">VOID_METHOD_TYPE</span><span class="plain-syntax">(</span><span class="constant-syntax">CONSTRUCT_VERIFY_MTID</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">owner</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> **</span><span class="identifier-syntax">E</span><span class="plain-syntax">)</span>
<span class="identifier-syntax">VOID_METHOD_TYPE</span><span class="plain-syntax">(</span><span class="constant-syntax">CONSTRUCT_VERIFY_CHILDREN_MTID</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> **</span><span class="identifier-syntax">E</span><span class="plain-syntax">)</span>

<span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="function-syntax">InterInstruction::verify</span><button class="popup" onclick="togglePopup('usagePopup16')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup16">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::verify</span></span>:<br/>Verifying Inter - <a href="3-vi.html#SP1_3">&#167;1.3</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">owner</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">VOID_METHOD_CALL</span><span class="plain-syntax">(</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="constant-syntax">CONSTRUCT_VERIFY_MTID</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">owner</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">E</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">E</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-in.html#SP6" class="function-link"><span class="function-syntax">Inode::tree</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">)-&gt;</span><span class="element-syntax">cross_referencing_suspended</span><span class="plain-syntax"> == </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><a href="3-ic.html#SP18" class="function-link"><span class="function-syntax">InterInstruction::xref</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="function-syntax">InterInstruction::verify_children</span><button class="popup" onclick="togglePopup('usagePopup17')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup17">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::verify_children</span></span>:<br/><a href="3-ic.html#SP7">&#167;7</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><a href="3-ic.html#SP14" class="function-link"><span class="function-syntax">InterInstruction::get_construct</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">IC</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">E</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">PL</span><span class="plain-syntax"> = </span><a href="2-in.html#SP13" class="function-link"><span class="function-syntax">Inode::get_level</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_THROUGH_INTER_CHILDREN</span><span class="plain-syntax">(</span><span class="identifier-syntax">C</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-in.html#SP13" class="function-link"><span class="function-syntax">Inode::get_level</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">C</span><span class="plain-syntax">) != </span><span class="identifier-syntax">PL</span><span class="plain-syntax"> + </span><span class="constant-syntax">1</span><span class="plain-syntax">)</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="2-in.html#SP15" class="function-link"><span class="function-syntax">Inode::error</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">I</span><span class="string-syntax">"child node has incorrect level"</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">VOID_METHOD_CALL</span><span class="plain-syntax">(</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="constant-syntax">CONSTRUCT_VERIFY_CHILDREN_MTID</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">E</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP18" class="paragraph-anchor"></a><b>&#167;18. </b>A second round of verification then happens when the whole of an Inter tree
has been read in from an external file. This enables us to cope with a situation
where property permissions occur before the properties or owners they permit,
or where property values occur before the permissions which allow them.
</p>

<p class="commentary">Note that this system is opt-in, and is used only when Inter is being read from
a file: when Inter is being generated in memory, cross-referencing happens
immediately.
</p>

<pre class="definitions code-font"><span class="definition-keyword">enum</span> <span class="constant-syntax">CONSTRUCT_XREF_MTID</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">VOID_METHOD_TYPE</span><span class="plain-syntax">(</span><span class="constant-syntax">CONSTRUCT_XREF_MTID</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> **</span><span class="identifier-syntax">E</span><span class="plain-syntax">)</span>

<span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="function-syntax">InterInstruction::xref</span><button class="popup" onclick="togglePopup('usagePopup18')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup18">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::xref</span></span>:<br/><a href="3-ic.html#SP17">&#167;17</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="3-ic.html#SP14" class="function-link"><span class="function-syntax">InterInstruction::get_construct</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">IC</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">VOID_METHOD_CALL</span><span class="plain-syntax">(</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="constant-syntax">CONSTRUCT_XREF_MTID</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">E</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::suspend_cross_referencing</span><button class="popup" onclick="togglePopup('usagePopup19')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup19">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::suspend_cross_referencing</span></span>:<br/>Inter in Binary Files - <a href="3-iibf.html#SP10">&#167;10</a><br/>Inter in Text Files - <a href="3-iitf.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">cross_referencing_suspended</span><span class="plain-syntax"> = </span><span class="identifier-syntax">TRUE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::resume_cross_referencing</span><button class="popup" onclick="togglePopup('usagePopup20')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup20">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::resume_cross_referencing</span></span>:<br/>Inter in Binary Files - <a href="3-iibf.html#SP10">&#167;10</a><br/>Inter in Text Files - <a href="3-iitf.html#SP1">&#167;1</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">I</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">cross_referencing_suspended</span><span class="plain-syntax"> = </span><span class="identifier-syntax">FALSE</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><a href="2-it.html#SP8" class="function-link"><span class="function-syntax">InterTree::traverse</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><a href="3-ic.html#SP18" class="function-link"><span class="function-syntax">InterInstruction::xref_node</span></a><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="constant-syntax">PERMISSION_IST</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><a href="2-it.html#SP8" class="function-link"><span class="function-syntax">InterTree::traverse</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><a href="3-ic.html#SP18" class="function-link"><span class="function-syntax">InterInstruction::xref_node</span></a><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">, -</span><span class="constant-syntax">PERMISSION_IST</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::xref_node</span><span class="plain-syntax">(</span><span class="reserved-syntax">inter_tree</span><span class="plain-syntax"> *</span><span class="identifier-syntax">I</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">state</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><a href="3-ic.html#SP18" class="function-link"><span class="function-syntax">InterInstruction::xref</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">E</span><span class="plain-syntax">) </span><a href="3-ie.html#SP5" class="function-link"><span class="function-syntax">InterErrors::issue</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">E</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP19" class="paragraph-anchor"></a><b>&#167;19. </b>This method writes out an instruction in textual Inter format, and this is
handled differently by each construct.
</p>

<pre class="definitions code-font"><span class="definition-keyword">enum</span> <span class="constant-syntax">CONSTRUCT_WRITE_MTID</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">VOID_METHOD_TYPE</span><span class="plain-syntax">(</span><span class="constant-syntax">CONSTRUCT_WRITE_MTID</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="identifier-syntax">text_stream</span><span class="plain-syntax"> *</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">)</span>

<span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="function-syntax">InterInstruction::write_construct_text</span><button class="popup" onclick="togglePopup('usagePopup21')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup21">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::write_construct_text</span></span>:<br/>Inter in Text Files - <a href="3-iitf.html#SP9">&#167;9</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-in.html#SP13" class="function-link"><span class="function-syntax">Inode::is</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="constant-syntax">NOP_IST</span><span class="plain-syntax">)) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-ic.html#SP19" class="function-link"><span class="function-syntax">InterInstruction::write_construct_text_allowing_nop</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>

<span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="function-syntax">InterInstruction::write_construct_text_allowing_nop</span><button class="popup" onclick="togglePopup('usagePopup22')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup22">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::write_construct_text_allowing_nop</span></span>:<br/>Inter Errors - <a href="3-ie.html#SP6">&#167;6</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><a href="3-ic.html#SP14" class="function-link"><span class="function-syntax">InterInstruction::get_construct</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">IC</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">E</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="constant-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">L</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">L</span><span class="plain-syntax">&lt;(</span><span class="constant-syntax">inter_ti</span><span class="plain-syntax">) </span><a href="2-in.html#SP13" class="function-link"><span class="function-syntax">Inode::get_level</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">); </span><span class="identifier-syntax">L</span><span class="plain-syntax">++) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"\t"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">VOID_METHOD_CALL</span><span class="plain-syntax">(</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="constant-syntax">CONSTRUCT_WRITE_MTID</span><span class="plain-syntax">, </span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">symbol_defn_field</span><span class="plain-syntax"> &gt;= </span><span class="constant-syntax">0</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">inter_symbol</span><span class="plain-syntax"> *</span><span class="identifier-syntax">con_name</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">            </span><a href="2-st.html#SP14" class="function-link"><span class="function-syntax">InterSymbolsTable::symbol_from_ID_at_node</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">symbol_defn_field</span><span class="plain-syntax">);</span>
<span class="plain-syntax">        </span><a href="2-ann.html#SP14" class="function-link"><span class="function-syntax">SymbolAnnotation::write_annotations</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">con_name</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"\n"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><a href="2-in.html#SP13" class="function-link"><span class="function-syntax">Inode::is</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="constant-syntax">PACKAGE_IST</span><span class="plain-syntax">))</span>
<span class="plain-syntax">        </span><a href="4-tpc.html#SP8" class="function-link"><span class="function-syntax">PackageInstruction::write_plugs_and_sockets</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">OUT</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP20" class="paragraph-anchor"></a><b>&#167;20. </b>A much less elegant presentation is just to dump the hexadecimal bytecode,
and this is used only for debugging or to show errors in binary Inter files.
</p>

<pre class="displayed-code all-displayed-code code-font">
<span class="reserved-syntax">void</span><span class="plain-syntax"> </span><span class="function-syntax">InterInstruction::instruction_writer</span><button class="popup" onclick="togglePopup('usagePopup23')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup23">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::instruction_writer</span></span>:<br/>Bytecode Module - <a href="1-bm.html#SP3_2">&#167;3.2</a></span></button><span class="plain-syntax">(</span><span class="identifier-syntax">OUTPUT_STREAM</span><span class="plain-syntax">, </span><span class="reserved-syntax">char</span><span class="plain-syntax"> *</span><span class="identifier-syntax">format_string</span><span class="plain-syntax">, </span><span class="reserved-syntax">void</span><span class="plain-syntax"> *</span><span class="identifier-syntax">vI</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">F</span><span class="plain-syntax"> = (</span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *) </span><span class="identifier-syntax">vI</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">F</span><span class="plain-syntax"> == </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">) { </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"&lt;no frame&gt;"</span><span class="plain-syntax">); </span><span class="reserved-syntax">return</span><span class="plain-syntax">; }</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%05d -&gt; "</span><span class="plain-syntax">, </span><span class="identifier-syntax">F</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">W</span><span class="plain-syntax">.</span><span class="element-syntax">index</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">"%d {"</span><span class="plain-syntax">, </span><span class="identifier-syntax">F</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">W</span><span class="plain-syntax">.</span><span class="element-syntax">extent</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">for</span><span class="plain-syntax"> (</span><span class="reserved-syntax">int</span><span class="plain-syntax"> </span><span class="identifier-syntax">i</span><span class="plain-syntax">=0; </span><span class="identifier-syntax">i</span><span class="function-syntax">&lt;F-&gt;</span><span class="element-syntax">W</span><span class="plain-syntax">.</span><span class="element-syntax">extent</span><span class="plain-syntax">; </span><span class="identifier-syntax">i</span><span class="plain-syntax">++) </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" %08x"</span><span class="plain-syntax">, </span><span class="identifier-syntax">F</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">W</span><span class="plain-syntax">.</span><span class="element-syntax">instruction</span><span class="plain-syntax">[</span><span class="identifier-syntax">i</span><span class="plain-syntax">]);</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">WRITE</span><span class="plain-syntax">(</span><span class="string-syntax">" }"</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP21" class="paragraph-anchor"></a><b>&#167;21. </b>Conversely, the function <a href="3-ic.html#SP21" class="internal">InterInstruction::match</a> takes a line of textual Inter
source code, uses the regular expressions for each construct to find which one
is being used, and then calls its <span class="extract"><span class="extract-syntax">CONSTRUCT_READ_MTID</span></span> method to ask for the
job to be completed.
</p>

<pre class="definitions code-font"><span class="definition-keyword">enum</span> <span class="constant-syntax">CONSTRUCT_READ_MTID</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">VOID_METHOD_TYPE</span><span class="plain-syntax">(</span><span class="constant-syntax">CONSTRUCT_READ_MTID</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_bookmark</span><span class="plain-syntax"> *,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_line_parse</span><span class="plain-syntax"> *, </span><span class="reserved-syntax">inter_error_location</span><span class="plain-syntax"> *, </span><span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> **</span><span class="identifier-syntax">E</span><span class="plain-syntax">)</span>

<span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="function-syntax">InterInstruction::match</span><button class="popup" onclick="togglePopup('usagePopup24')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup24">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::match</span></span>:<br/>Inter in Text Files - <a href="3-iitf.html#SP3">&#167;3</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_line_parse</span><span class="plain-syntax"> *</span><span class="identifier-syntax">ilp</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_error_location</span><span class="plain-syntax"> *</span><span class="identifier-syntax">eloc</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_bookmark</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">LOOP_OVER</span><span class="plain-syntax">(</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax">)</span>
<span class="plain-syntax">        </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">recognition_regexp</span><span class="plain-syntax">[0])</span>
<span class="plain-syntax">            </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">Regexp::match</span><span class="plain-syntax">(&amp;</span><span class="identifier-syntax">ilp</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">mr</span><span class="plain-syntax">, </span><span class="identifier-syntax">ilp</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">line</span><span class="plain-syntax">, </span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">recognition_regexp</span><span class="plain-syntax">)) {</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E</span><span class="plain-syntax"> =</span>
<span class="plain-syntax">                    </span><a href="3-ic.html#SP6" class="function-link"><span class="function-syntax">InterInstruction::check_level_in_package</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="identifier-syntax">ilp</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">indent_level</span><span class="plain-syntax">, </span><span class="identifier-syntax">eloc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">E</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">if</span><span class="plain-syntax"> ((</span><a href="2-ann.html#SP10" class="function-link"><span class="function-syntax">SymbolAnnotation::nonempty</span></a><span class="plain-syntax">(&amp;(</span><span class="identifier-syntax">ilp</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">set</span><span class="plain-syntax">))) &amp;&amp; (</span><span class="identifier-syntax">IC</span><span class="plain-syntax">-&gt;</span><span class="element-syntax">symbol_defn_field</span><span class="plain-syntax"> &lt; </span><span class="constant-syntax">0</span><span class="plain-syntax">))</span>
<span class="plain-syntax">                    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-ie.html#SP4" class="function-link"><span class="function-syntax">InterErrors::plain</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"__annotations are not allowed"</span><span class="plain-syntax">, </span><span class="identifier-syntax">eloc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="identifier-syntax">VOID_METHOD_CALL</span><span class="plain-syntax">(</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="constant-syntax">CONSTRUCT_READ_MTID</span><span class="plain-syntax">, </span><span class="identifier-syntax">IBM</span><span class="plain-syntax">, </span><span class="identifier-syntax">ilp</span><span class="plain-syntax">, </span><span class="identifier-syntax">eloc</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">E</span><span class="plain-syntax">);</span>
<span class="plain-syntax">                </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">            }</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><a href="3-ie.html#SP4" class="function-link"><span class="function-syntax">InterErrors::plain</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">I</span><span class="string-syntax">"bad inter line"</span><span class="plain-syntax">, </span><span class="identifier-syntax">eloc</span><span class="plain-syntax">);</span>
<span class="plain-syntax">}</span>
</pre>
<p class="commentary firstcommentary"><a id="SP22" class="paragraph-anchor"></a><b>&#167;22. </b>Transposition is an awkward necessity when binary Inter is read in from a file,
and some references in its instruction bytecode need to be modified: this is
not the place to explain it. See <a href="3-iibf.html" class="internal">Inter in Binary Files</a>.
</p>

<pre class="definitions code-font"><span class="definition-keyword">enum</span> <span class="constant-syntax">CONSTRUCT_TRANSPOSE_MTID</span>
</pre>
<pre class="displayed-code all-displayed-code code-font">
<span class="identifier-syntax">VOID_METHOD_TYPE</span><span class="plain-syntax">(</span><span class="constant-syntax">CONSTRUCT_TRANSPOSE_MTID</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="constant-syntax">inter_ti</span><span class="plain-syntax"> *</span><span class="identifier-syntax">grid</span><span class="plain-syntax">, </span><span class="constant-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">max</span><span class="plain-syntax">, </span><span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> **</span><span class="identifier-syntax">E</span><span class="plain-syntax">)</span>

<span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="function-syntax">InterInstruction::transpose_construct</span><button class="popup" onclick="togglePopup('usagePopup25')"><span class="comment-syntax">?</span><span class="popuptext" id="usagePopup25">Usage of <span class="code-font"><span class="function-syntax">InterInstruction::transpose_construct</span></span>:<br/>Inter in Binary Files - <a href="3-iibf.html#SP10_1_5_3">&#167;10.1.5.3</a></span></button><span class="plain-syntax">(</span><span class="reserved-syntax">inter_package</span><span class="plain-syntax"> *</span><span class="identifier-syntax">owner</span><span class="plain-syntax">,</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_tree_node</span><span class="plain-syntax"> *</span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="constant-syntax">inter_ti</span><span class="plain-syntax"> *</span><span class="identifier-syntax">grid</span><span class="plain-syntax">, </span><span class="constant-syntax">inter_ti</span><span class="plain-syntax"> </span><span class="identifier-syntax">max</span><span class="plain-syntax">) {</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_construct</span><span class="plain-syntax"> *</span><span class="identifier-syntax">IC</span><span class="plain-syntax"> = </span><span class="identifier-syntax">NULL</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">inter_error_message</span><span class="plain-syntax"> *</span><span class="identifier-syntax">E</span><span class="plain-syntax"> = </span><a href="3-ic.html#SP14" class="function-link"><span class="function-syntax">InterInstruction::get_construct</span></a><span class="plain-syntax">(</span><span class="identifier-syntax">P</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">IC</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">if</span><span class="plain-syntax"> (</span><span class="identifier-syntax">E</span><span class="plain-syntax">) </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">    </span><span class="identifier-syntax">VOID_METHOD_CALL</span><span class="plain-syntax">(</span><span class="identifier-syntax">IC</span><span class="plain-syntax">, </span><span class="constant-syntax">CONSTRUCT_TRANSPOSE_MTID</span><span class="plain-syntax">, </span><span class="identifier-syntax">P</span><span class="plain-syntax">, </span><span class="identifier-syntax">grid</span><span class="plain-syntax">, </span><span class="identifier-syntax">max</span><span class="plain-syntax">, &amp;</span><span class="identifier-syntax">E</span><span class="plain-syntax">);</span>
<span class="plain-syntax">    </span><span class="reserved-syntax">return</span><span class="plain-syntax"> </span><span class="identifier-syntax">E</span><span class="plain-syntax">;</span>
<span class="plain-syntax">}</span>
</pre>
<nav role="progress"><div class="progresscontainer">
    <ul class="progressbar"><li class="progressprev"><a href="2-trn.html">&#10094;</a></li><li class="progresschapter"><a href="P-wtmd.html">P</a></li><li class="progresschapter"><a href="1-bm.html">1</a></li><li class="progresschapter"><a href="2-it.html">2</a></li><li class="progresscurrentchapter">3</li><li class="progresscurrent">ic</li><li class="progresssection"><a href="3-iibf.html">iibf</a></li><li class="progresssection"><a href="3-iitf.html">iitf</a></li><li class="progresssection"><a href="3-vi.html">vi</a></li><li class="progresssection"><a href="3-ivp.html">ivp</a></li><li class="progresssection"><a href="3-idt.html">idt</a></li><li class="progresssection"><a href="3-mtd.html">mtd</a></li><li class="progresssection"><a href="3-ie.html">ie</a></li><li class="progresssection"><a href="3-tp.html">tp</a></li><li class="progresschapter"><a href="4-tcc.html">4</a></li><li class="progresschapter"><a href="5-tac.html">5</a></li><li class="progresschapter"><a href="6-tpc.html">6</a></li><li class="progressnext"><a href="3-iibf.html">&#10095;</a></li></ul></div>
</nav><!-- End of weave -->

		</main>
	</body>
</html>

